package ch.elektroplan.cmueller.logikModulGenerator.business.elements;

public class Output {

	private static int TYPE = 5004;
	private int number;
	private String initialisationValue = ""+0;
	private int round = 0;
	private int dataformat = 0;
	private String comment;
	private int sendONChanche = 1;
	private String name = "Ausgang";

	public Output(int number) {

		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public void setInitialisationValue(String initialisationValue) {
		if (initialisationValue != null) {
			this.initialisationValue = initialisationValue;

		}
		this.initialisationValue = "" + 0;
	}

	public void setRound(int round) {
		if (round == 1 || round == 0) {
			this.round = round;

		}
		this.round = 1;
	}

	public void setDataformat(int dataformat) {
		if (dataformat == 1 || dataformat == 0) {
			this.dataformat = dataformat;

		}
		this.dataformat = 1;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public void setSendONChanche(int sendONChanche) {
		if (sendONChanche == 1 || sendONChanche == 0) {
			this.sendONChanche = sendONChanche;

		}
		this.sendONChanche = 1;
	}

	public String getoutputstring() {

		String output = TYPE + "|" + number + "|" + initialisationValue + "|"
				+ round + "|" + sendONChanche + dataformat;

		return output;

	}

	public String getinputComment() {
		return "#" + this.comment;

	}

}
